cmake_minimum_required(VERSION 2.8)  # 指定最低cmake版本

project(dji_control_v2) # 设置project的名称，后面PROJECT_NAME就会被改成这个
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -g -O0") # 设置cmake的FLAGS信息
# add_definitions(-DDEBUG)
# add_definitions(-DMOBILITY_COUT)
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_CURRENT_SOURCE_DIR}/include/mylog4cplus
    ${CMAKE_CURRENT_SOURCE_DIR}/include/Redis
    ${CMAKE_CURRENT_SOURCE_DIR}/include/yaml-cpp/include
    ${CMAKE_CURRENT_SOURCE_DIR}/include/urlRequest
    ${CMAKE_CURRENT_SOURCE_DIR}/include/nlohmann
    ${CMAKE_CURRENT_SOURCE_DIR}/src/proxy
    ${CMAKE_CURRENT_SOURCE_DIR}/src/datastructure
    
) # 设置头文件的搜索路径

file(GLOB_RECURSE SRC_FILES 
    ${CMAKE_CURRENT_SOURCE_DIR}/include/mylog4cplus/*.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/include/urlRequest/*.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/include/yaml-cpp/src/*.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp    
    )

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build) 

add_executable(${PROJECT_NAME} ${SRC_FILES})
# target_link_libraries(${PROJECT_NAME} curl log4cplus fmt)  # 链接 libcurl.so 动态库,系统的，不用找动态库地址 link_directories(${CMAKE_SOURCE_DIR}/lib)
target_link_libraries(${PROJECT_NAME} log4cplus curl)